//
// Created by ashCheng on 2022/12/30.
//
#include <iostream>

int main() {
  //初始化
  int i = 0, &r = i;
  auto a = r;
  const int ci = i, &cr = ci;
  auto b = ci;
  auto c = cr;
  auto d = &i;
  auto e = &ci;
  const auto f = ci;
  auto &g = ci;
//  auto &h = 42;     //错误：不能为非常量引用绑定字面值
  //2.34输出变量赋值前后内容
  std::cout << "赋值前: a = " << a
            << ", b = " << b
            << ", c = " << c
            << ", d = " << d
            << ", e = " << e
            << ", g = " << g
            << std::endl;
  a = 42;
  b = 42;
  c = 42;
//  d = 42;
//  e = 42;
//  g = 42;
  std::cout << "赋值后: a = " << a
            << ", b = " << b
            << std::endl;
  return 0;
}